package com.dianping.cat.consumer.heartbeat.model.entity;

import com.dianping.cat.consumer.heartbeat.model.BaseEntity;
import com.dianping.cat.consumer.heartbeat.model.IVisitor;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;



















public class Period
  extends BaseEntity<Period>
{
  private int m_minute;
  private int m_threadCount;
  private int m_daemonCount;
  private int m_totalStartedCount;
  private int m_catThreadCount;
  private int m_pigeonThreadCount;
  private int m_httpThreadCount;
  private long m_newGcCount;
  private long m_oldGcCount;
  private long m_memoryFree;
  private long m_heapUsage;
  private long m_noneHeapUsage;
  private double m_systemLoadAverage;
  private long m_catMessageProduced;
  private long m_catMessageOverflow;
  private double m_catMessageSize;
/*  47 */   private List<Disk> m_disks = new ArrayList();

/*  49 */   private Map<String, Extension> m_extensions = new LinkedHashMap();

/*  51 */   private Map<String, String> m_dynamicAttributes = new LinkedHashMap();





/*  57 */   public Period(int minute) { this.m_minute = minute; }




/*  62 */   public void accept(IVisitor visitor) { visitor.visitPeriod(this); }


  public Period addDisk(Disk disk) {
/*  66 */     this.m_disks.add(disk);
/*  67 */     return this;
  }

  public Period addExtension(Extension extension) {
/*  71 */     this.m_extensions.put(extension.getId(), extension);
/*  72 */     return this;
  }


  public boolean equals(Object obj) {
/*  77 */     if (obj instanceof Period) {
      Period _o = (Period)obj;

/*  80 */       if (getMinute() != _o.getMinute()) {
/*  81 */         return false;
      }

/*  84 */       return true;
    }

/*  87 */     return false;
  }

  public Disk findDisk(String path) {
/*  91 */     for (Disk disk : this.m_disks) {
/*  92 */       if (!equals(disk.getPath(), path)) {
        continue;
      }

/*  96 */       return disk;
    }

/*  99 */     return null;
  }


/* 103 */   public Extension findExtension(String id) { return (Extension)this.m_extensions.get(id); }


  public Extension findOrCreateExtension(String id) {
/* 107 */     Extension extension = (Extension)this.m_extensions.get(id);

/* 109 */     if (extension == null) {
/* 110 */       synchronized (this.m_extensions) {
/* 111 */         extension = (Extension)this.m_extensions.get(id);

/* 113 */         if (extension == null) {
/* 114 */           extension = new Extension(id);
/* 115 */           this.m_extensions.put(id, extension);
        }
      }
    }

/* 120 */     return extension;
  }


/* 124 */   public String getDynamicAttribute(String name) { return (String)this.m_dynamicAttributes.get(name); }



/* 128 */   public Map<String, String> getDynamicAttributes() { return this.m_dynamicAttributes; }



/* 132 */   public long getCatMessageOverflow() { return this.m_catMessageOverflow; }



/* 136 */   public long getCatMessageProduced() { return this.m_catMessageProduced; }



/* 140 */   public double getCatMessageSize() { return this.m_catMessageSize; }



/* 144 */   public int getCatThreadCount() { return this.m_catThreadCount; }



/* 148 */   public int getDaemonCount() { return this.m_daemonCount; }



/* 152 */   public List<Disk> getDisks() { return this.m_disks; }



/* 156 */   public Map<String, Extension> getExtensions() { return this.m_extensions; }



/* 160 */   public long getHeapUsage() { return this.m_heapUsage; }



/* 164 */   public int getHttpThreadCount() { return this.m_httpThreadCount; }



/* 168 */   public long getMemoryFree() { return this.m_memoryFree; }



/* 172 */   public int getMinute() { return this.m_minute; }



/* 176 */   public long getNewGcCount() { return this.m_newGcCount; }



/* 180 */   public long getNoneHeapUsage() { return this.m_noneHeapUsage; }



/* 184 */   public long getOldGcCount() { return this.m_oldGcCount; }



/* 188 */   public int getPigeonThreadCount() { return this.m_pigeonThreadCount; }



/* 192 */   public double getSystemLoadAverage() { return this.m_systemLoadAverage; }



/* 196 */   public int getThreadCount() { return this.m_threadCount; }



/* 200 */   public int getTotalStartedCount() { return this.m_totalStartedCount; }






  public void mergeAttributes(Period other) {
/* 214 */     assertAttributeEquals(other, "period", "minute", Integer.valueOf(this.m_minute), Integer.valueOf(other.getMinute()));

/* 216 */     for (Map.Entry<String, String> e : other.getDynamicAttributes().entrySet()) {
/* 217 */       this.m_dynamicAttributes.put(e.getKey(), e.getValue());
    }

/* 220 */     this.m_threadCount = other.getThreadCount();

/* 222 */     this.m_daemonCount = other.getDaemonCount();

/* 224 */     this.m_totalStartedCount = other.getTotalStartedCount();

/* 226 */     this.m_catThreadCount = other.getCatThreadCount();

/* 228 */     this.m_pigeonThreadCount = other.getPigeonThreadCount();

/* 230 */     this.m_httpThreadCount = other.getHttpThreadCount();

/* 232 */     this.m_newGcCount = other.getNewGcCount();

/* 234 */     this.m_oldGcCount = other.getOldGcCount();

/* 236 */     this.m_memoryFree = other.getMemoryFree();

/* 238 */     this.m_heapUsage = other.getHeapUsage();

/* 240 */     this.m_noneHeapUsage = other.getNoneHeapUsage();

/* 242 */     this.m_systemLoadAverage = other.getSystemLoadAverage();

/* 244 */     this.m_catMessageProduced = other.getCatMessageProduced();

/* 246 */     this.m_catMessageOverflow = other.getCatMessageOverflow();

/* 248 */     this.m_catMessageSize = other.getCatMessageSize();
  }

  public Disk removeDisk(String path) {
/* 252 */     int len = this.m_disks.size();

/* 254 */     for (int i = 0; i < len; ) {
/* 255 */       Disk disk = (Disk)this.m_disks.get(i);

/* 257 */       if (!equals(disk.getPath(), path)) {
        i++;
        continue;
      }
/* 261 */       return (Disk)this.m_disks.remove(i);
    }

/* 264 */     return null;
  }


/* 268 */   public Extension removeExtension(String id) { return (Extension)this.m_extensions.remove(id); }



/* 272 */   public void setDynamicAttribute(String name, String value) { this.m_dynamicAttributes.put(name, value); }


  public Period setCatMessageOverflow(long catMessageOverflow) {
/* 276 */     this.m_catMessageOverflow = catMessageOverflow;
/* 277 */     return this;
  }

  public Period setCatMessageProduced(long catMessageProduced) {
/* 281 */     this.m_catMessageProduced = catMessageProduced;
/* 282 */     return this;
  }

  public Period setCatMessageSize(double catMessageSize) {
/* 286 */     this.m_catMessageSize = catMessageSize;
/* 287 */     return this;
  }

  public Period setCatThreadCount(int catThreadCount) {
/* 291 */     this.m_catThreadCount = catThreadCount;
/* 292 */     return this;
  }

  public Period setDaemonCount(int daemonCount) {
/* 296 */     this.m_daemonCount = daemonCount;
/* 297 */     return this;
  }

  public Period setHeapUsage(long heapUsage) {
/* 301 */     this.m_heapUsage = heapUsage;
/* 302 */     return this;
  }

  public Period setHttpThreadCount(int httpThreadCount) {
/* 306 */     this.m_httpThreadCount = httpThreadCount;
/* 307 */     return this;
  }

  public Period setMemoryFree(long memoryFree) {
/* 311 */     this.m_memoryFree = memoryFree;
/* 312 */     return this;
  }

  public Period setMinute(int minute) {
/* 316 */     this.m_minute = minute;
/* 317 */     return this;
  }

  public Period setNewGcCount(long newGcCount) {
/* 321 */     this.m_newGcCount = newGcCount;
/* 322 */     return this;
  }

  public Period setNoneHeapUsage(long noneHeapUsage) {
/* 326 */     this.m_noneHeapUsage = noneHeapUsage;
/* 327 */     return this;
  }

  public Period setOldGcCount(long oldGcCount) {
/* 331 */     this.m_oldGcCount = oldGcCount;
/* 332 */     return this;
  }

  public Period setPigeonThreadCount(int pigeonThreadCount) {
/* 336 */     this.m_pigeonThreadCount = pigeonThreadCount;
/* 337 */     return this;
  }

  public Period setSystemLoadAverage(double systemLoadAverage) {
/* 341 */     this.m_systemLoadAverage = systemLoadAverage;
/* 342 */     return this;
  }

  public Period setThreadCount(int threadCount) {
/* 346 */     this.m_threadCount = threadCount;
/* 347 */     return this;
  }

  public Period setTotalStartedCount(int totalStartedCount) {
/* 351 */     this.m_totalStartedCount = totalStartedCount;
/* 352 */     return this;
  }

  public Period() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/heartbeat/model/entity/Period.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */